
<!DOCTYPE html>
<html>
  <head>
    <script>
	function myFunction()
	{
	alert("Hello World!");
	
	} 
	function appendResults(text) {
        var results = document.getElementById('results');
        results.appendChild(document.createElement('P'));
        results.appendChild(document.createTextNode(text));
      }

      function makeRequest() {
        var request = gapi.client.urlshortener.url.get({
          'shortUrl': 'http://goo.gl/fbsS'
        });
        request.execute(function(response) {
          appendResults(response.longUrl);
        });
      }

      function load() {
        gapi.client.setApiKey('AIzaSyCWLPAcvKGNncL5FXbHwOGqMYaBKW497Jo');
        gapi.client.load('urlshortener', 'v1', makeRequest);
      } 
    </script>
  <script src="https://apis.google.com/js/client.js?onload=load"></script>
  </head>
  <body>
  
<button onclick="myFunction()">Try it</button>
    <div id="results"></div>
  </body>
</html>